﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using System.Web;
using System.Diagnostics;

namespace CustomMVC
{
    public class OpLog : ActionFilterAttribute
    {
        public string opDesc;

        public OpLog(string op)
        {
            Order = 1;
            opDesc = op;
        }

        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            HttpRequestBase req = filterContext.HttpContext.Request;
            if (req.IsAjaxRequest())
            {
                Trace.WriteLine(DateTime.Now + opDesc + "\n\r");              
            }
        }

        
    }
}
